package com.example.designer.abstractfactory.factory;

import com.example.designer.abstractfactory.Color;
import com.example.designer.abstractfactory.Factory;
import com.example.designer.factory.Car;
import com.example.designer.factory.impl.BaoMa;
import com.example.designer.factory.impl.BenChi;
import com.example.designer.factory.impl.DaZhon;

/**
 * 汽车工厂类
 */
public class CarFactory implements Factory {

    @Override
    public Car getCar(String type) {
        if (type == null && type == "") {
            return null;
        }
        switch (type) {
            case "BAOMA":
                return new BaoMa();
            case "BENCHI":
                return new BenChi();
            case "DAZHON":
                return new DaZhon();
            default:
                return null;
        }
    }


    @Override
    public Color getColor(String type) {
        return null;
    }
}
